package com.lsl.mapper;

import com.lsl.bean.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    @Select("select * from user")
    public List<User> selectAll();

    @Select("select * from user where id=#{id}")
    public User selectById(int id);

    @Delete("delete from user where id=#{id}")
    public int deleteById(int id);

    @Insert("insert into user (username,address) values(#{username},#{address})")
    public int insertInfo(User user);

    @Update("update user set username=#{username},address=#{address} where id=#{id}")
    public int updateById(User user);

}
